<?php
class kao
{
    public function shu()
    {
        $a[] = array(1, 2, 3, 4);
        for ($i = 1; $i < 5; $i++) {
            for ($j = 1; $j < 5; $j++) {
                for ($k = 1; $k < 5; $k++) {
                    if (($i != $j) && ($i != $k) && ($j != $k)) {
                        printf("%d%d%d\n", "$i." + ".$j." . +".$k");
                    }
                }
            }
        }
        echo $a;
    }
    function globdir($dir, $filter = '*', $patten = GLOB_BRACE, $nocache = null) {
        static $file_arr = array ();
        isset($nocache) && $file_arr = array ();
        if (!is_dir($dir)) return;
        if ($patten == GLOB_ONLYDIR) {
            $code = 'if (is_dir($file)) {$file_arr[] = $file;globdir($file, "*", GLOB_ONLYDIR);}';
        } else {
            $code = 'is_file($file) ? $file_arr[] = $file : globdir($file,"' . $filter . '",' . $patten . ');';
        }
        array_walk(glob("{$dir}/{$filter}", $patten), create_function('$file, $k, $file_arr', $code), &$file_arr);
        if ($filter != '*') {
            array_walk(glob("{$dir}/*", GLOB_ONLYDIR), create_function('$dir,$k,$param', 'list($filter, $patten) = explode("|", $param);globdir($dir, $filter, $patten);'), "{$filter}|{$patten}");
        }
        return $file_arr;
    }

}

